import 'package:flutter/material.dart';

class DDViewBackGround extends StatefulWidget {
  final Widget content;
  final EdgeInsets margin;
  final Color borderColor;
  final double borderWidth;
  final double borderRadius;
  final Color boxShadowColor;
  final Offset boxShadowOffset;

  const DDViewBackGround(
      {Key? key,
      required this.content,
      this.margin = const EdgeInsets.all(0),
      this.borderColor = const Color(0xFF4C5961),
      this.borderWidth = 1.5,
      this.borderRadius = 8,
      this.boxShadowColor =  Colors.black,
      this.boxShadowOffset = const Offset(1, 1)})
      : super(key: key);

  @override
  State<DDViewBackGround> createState() => _DDViewBackGroundState();
}

class _DDViewBackGroundState extends State<DDViewBackGround> {
  @override
  Widget build(BuildContext context) {
    return Container(
        margin:widget.margin,
        decoration: BoxDecoration(
          color: Colors.white,
          border: Border.all(
            color: widget.borderColor,
            width: widget.borderWidth,
          ),
          borderRadius: BorderRadius.circular(widget.borderRadius),
          boxShadow: [
            BoxShadow(
              color: widget.boxShadowColor,
              spreadRadius: 0.6,
              blurRadius: 0,
              offset: widget.boxShadowOffset,
            ),
          ],
        ),
        child: widget.content);
  }
}
